package com.softeem.util;




/**
 枚举类,用于返回异常信息
 */
public enum ResultEnum implements IResultCode {

    SUCCESS(200, "操作成功!"),
    ERROR_500(500, "服务器内部异常!"),
    ERROR_IO_500(500, "io异常!"),
    ERROR_SQL_500(500, "sql语句异常!"),
    ERROR_201(201, "数据重复,请检查!"),
    ERROR_401(401, "尚未登陆,请登录!"),
    ERROR_403(403, "权限不足,请联系管理员!"),
    ERROR_400(400, "参数错误!");

    private final Integer code;  // 状态码

    private final String message; // 返回的消息

    /**
     * 构造方法
     *
     * @param code    状态码
     * @param message 消息
     */
    private ResultEnum(final Integer code, final String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}

